

import 'package:intl/intl.dart';

extension YKExtensionDateTime on DateTime {

  String format({String formatStr = "yyyy-MM-dd HH:mm"}) {
    String formattedString = DateFormat(formatStr).format(this);
    return formattedString;
  }

  int get timeStamp => _getTimeStamp();

  int _getTimeStamp() {
    return this.millisecondsSinceEpoch ~/ 1000;
  }

}